Skip to content

Conversation

@abays
Copy link
Contributor

@abays abays commented Nov 13, 2025

This commit migrates the openstack-baremetal-operator from Operator SDK 1.31.0 to 1.41.1, following the new project structure and best practices introduced in the newer SDK version.

Major Changes:

Project Structure Reorganization:

  • Moved entry point from root main.go to cmd/main.go
  • Migrated pkg/ directory to internal/ structure
  • Moved controllers from controllers/ to internal/controller/
  • Created internal/webhook/v1beta1/ for webhook registration
  • Reorganized internal packages: openstackbaremetalset/ and openstackprovisionserver/

Webhook Architecture Updates:

  • Separated webhook registration (internal/webhook/v1beta1/) from webhook logic (api/v1beta1/*_webhook.go)
  • Removed kubebuilder:webhook annotations from API webhook files
  • Updated webhook setup to use internal webhook registration functions
  • Added SetupWebhookClient() function for proper client initialization
  • Updated test files to use new webhook structure

Configuration Updates:

  • Cert-Manager: Split certificate.yaml into certificate-webhook.yaml and certificate-metrics.yaml, added issuer.yaml
  • Metrics: Added metrics_service.yaml, manager_metrics_patch.yaml, and cert_metrics_manager_patch.yaml
  • RBAC: Added metrics_auth_role.yaml, metrics_auth_role_binding.yaml, metrics_reader_role.yaml, and admin roles for CRs
  • Network Policies: Added allow-metrics-traffic.yaml and allow-webhook-traffic.yaml
  • Prometheus: Updated monitor.yaml and added monitor_tls_patch.yaml
  • Removed deprecated auth proxy configurations
  • Updated manager.yaml with new labels, security context, and resource limits

Build System:

  • Updated Makefile for new project structure
  • Updated PROJECT file with new layout and plugin version
  • Updated Dockerfile to use new cmd/main.go entry point
  • Updated .ci-operator.yaml

Test Updates:

  • Updated tests/functional/suit_test.go to use internal/webhook/v1beta1
  • Updated test imports to use internal/controller instead of controllers

Related: https://issues.redhat.com/browse/OSPRH-21931

Co-authored-by: Composer AI [email protected]

Depends-On: openstack-k8s-operators/openstack-operator#1683

@openshift-ci openshift-ci bot requested review from steveb and viroel November 13, 2025 19:44
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/d3b1be75a102487ba94b7e6101d4aa44

openstack-baremetal-operator-content-provider FAILURE in 8m 22s
⚠️ openstack-baremetal-operator-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-baremetal-operator-content-provider

@abays abays force-pushed the operator_sdk_1.41.1 branch from 51a6aa9 to 222b1ed Compare November 14, 2025 08:55
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/c35ac5afc1e24f2892c1654c314e770c

openstack-baremetal-operator-content-provider FAILURE in 8m 20s
⚠️ openstack-baremetal-operator-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-baremetal-operator-content-provider

@abays
Copy link
Contributor Author

abays commented Nov 14, 2025

This is failing on the when Creating ProvisionServer with duplicate port [BeforeEach] it should succeed when using different port. But everything passes for me when I run make test locally. Not sure what is going on.

@abays
Copy link
Contributor Author

abays commented Nov 14, 2025

@abays: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
Test name Commit Details Required Rerun command
ci/prow/openstack-baremetal-operator-build-deploy 51a6aa9 link false /test openstack-baremetal-operator-build-deploy
ci/prow/precommit-check 222b1ed link true /test precommit-check

Full PR test history. Your PR dashboard.

This is expected at the moment. Need to add Depends-On.

@abays
Copy link
Contributor Author

abays commented Nov 14, 2025

recheck

@rabi
Copy link
Contributor

rabi commented Nov 14, 2025

This is failing on the when Creating ProvisionServer with duplicate port [BeforeEach] it should succeed when using different port. But everything passes for me when I run make test locally. Not sure what is going on.

Hmm.. I see other PRs also faling with that test.. Maybe we can avoid using a fixed port. let me propose something.

@rabi
Copy link
Contributor

rabi commented Nov 14, 2025

This is failing on the when Creating ProvisionServer with duplicate port [BeforeEach] it should succeed when using different port. But everything passes for me when I run make test locally. Not sure what is going on.

Hmm.. I see other PRs also faling with that test.. Maybe we can avoid using a fixed port. let me propose something.

#357

@rabi
Copy link
Contributor

rabi commented Nov 14, 2025

This is failing on the when Creating ProvisionServer with duplicate port [BeforeEach] it should succeed when using different port. But everything passes for me when I run make test locally. Not sure what is going on.

Hmm.. I see other PRs also faling with that test.. Maybe we can avoid using a fixed port. let me propose something.

Sorry I edited your comment and messed it up.

cmd/main.go Outdated
}
}

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

healthz.Ping -> checker ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Fixed.

@abays abays force-pushed the operator_sdk_1.41.1 branch 2 times, most recently from acb5a5f to b9a662b Compare November 14, 2025 12:56
@softwarefactory-project-zuul
Copy link

This change depends on a change that failed to merge.

Change openstack-k8s-operators/install_yamls#1110 is needed.

@abays abays force-pushed the operator_sdk_1.41.1 branch from b9a662b to 550a8f0 Compare November 14, 2025 14:27
@softwarefactory-project-zuul
Copy link

This change depends on a change that failed to merge.

Change openstack-k8s-operators/openstack-operator#1683 is needed.

@abays abays force-pushed the operator_sdk_1.41.1 branch from 550a8f0 to a8dfcf0 Compare November 14, 2025 16:16
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/eadd35b9f23048728f1a8c1c90544c30

openstack-baremetal-operator-content-provider FAILURE in 12m 04s
⚠️ openstack-baremetal-operator-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-baremetal-operator-content-provider

@abays
Copy link
Contributor Author

abays commented Nov 14, 2025

Build failed (check pipeline). Post recheck (without leading slash) to rerun all jobs. Make sure the failure cause has been resolved before you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/eadd35b9f23048728f1a8c1c90544c30

openstack-baremetal-operator-content-provider FAILURE in 12m 04s ⚠️ openstack-baremetal-operator-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-baremetal-operator-content-provider

    - 'Error: creating build container: unable to copy from source docker://registry.access.redhat.com/ubi9/ubi-minimal:9.6:
      copying system image from manifest list: determining manifest MIME type for docker://registry.access.redhat.com/ubi9/ubi-minimal:9.6:
      Manifest does not match provided manifest digest sha256:d1bad2a2790eac1651e57e78159a81b72ddfa7b836936b26cf51e09744bf1c2d'

@abays
Copy link
Contributor Author

abays commented Nov 14, 2025

recheck

@abays abays force-pushed the operator_sdk_1.41.1 branch 2 times, most recently from 85a1590 to 7d9f8e9 Compare November 20, 2025 10:53

return ctrl.NewWebhookManagedBy(mgr).
For(r).
Complete()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove SetupWebhookWithManager

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

var metricsCertPath, metricsCertName, metricsCertKey string
var webhookCertPath, webhookCertName, webhookCertKey string
var enableLeaderElection bool
var probeAddr string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should readd pprofBindAddress

var pprofBindAddress string

could do in a follow up

Comment on lines 7 to 8
newName: quay.io/andrewbays/openstack-baremetal-operator
newTag: v0.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

@abays abays force-pushed the operator_sdk_1.41.1 branch from 7d9f8e9 to f1ca67e Compare November 24, 2025 15:53
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3666bb514f99441fb4c57f623837bf66

openstack-baremetal-operator-content-provider FAILURE in 5m 35s
⚠️ openstack-baremetal-operator-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-baremetal-operator-content-provider

@abays abays force-pushed the operator_sdk_1.41.1 branch 3 times, most recently from 08e7898 to f30c66f Compare November 25, 2025 11:39
This commit migrates the openstack-baremetal-operator from Operator SDK
1.31.0 to 1.41.1, following the new project structure and best practices
introduced in the newer SDK version.

Major Changes:

Project Structure Reorganization:
- Moved entry point from root main.go to cmd/main.go
- Migrated pkg/ directory to internal/ structure
- Moved controllers from controllers/ to internal/controller/
- Created internal/webhook/v1beta1/ for webhook registration
- Reorganized internal packages: openstackbaremetalset/ and openstackprovisionserver/

Webhook Architecture Updates:
- Separated webhook registration (internal/webhook/v1beta1/) from webhook
  logic (api/v1beta1/*_webhook.go)
- Removed kubebuilder:webhook annotations from API webhook files
- Updated webhook setup to use internal webhook registration functions
- Added SetupWebhookClient() function for proper client initialization
- Updated test files to use new webhook structure

Configuration Updates:
- Cert-Manager: Split certificate.yaml into certificate-webhook.yaml and
  certificate-metrics.yaml, added issuer.yaml
- Metrics: Added metrics_service.yaml, manager_metrics_patch.yaml, and
  cert_metrics_manager_patch.yaml
- RBAC: Added metrics_auth_role.yaml, metrics_auth_role_binding.yaml,
  metrics_reader_role.yaml, and admin roles for CRs
- Network Policies: Added allow-metrics-traffic.yaml and
  allow-webhook-traffic.yaml
- Prometheus: Updated monitor.yaml and added monitor_tls_patch.yaml
- Removed deprecated auth proxy configurations
- Updated manager.yaml with new labels, security context, and resource limits

Build System:
- Updated Makefile for new project structure
- Updated PROJECT file with new layout and plugin version
- Updated Dockerfile to use new cmd/main.go entry point
- Updated .ci-operator.yaml

Test Updates:
- Updated tests/functional/suit_test.go to use internal/webhook/v1beta1
- Updated test imports to use internal/controller instead of controllers

Related: https://issues.redhat.com/browse/OSPRH-21931

Co-authored-by: Composer AI <[email protected]>
@abays abays force-pushed the operator_sdk_1.41.1 branch from f30c66f to e447eed Compare November 25, 2025 11:47
Copy link
Contributor

@stuggi stuggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 9b1fcb2 into openstack-k8s-operators:main Nov 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants